var express = require('express');
var router = express.Router();
var mysql = require('mysql')
var models = require('../../sql/db')
var $sql = require('../../sql/sqlMap')

var connection = mysql.createConnection(models.mysql)
connection.connect()
// 登录验证语句
var sql = $sql.ncovUser.ncovGetProfile

router.get('/:username', function (req, res, next) {
    var username = req.params.username
    connection.query(sql, [username], (err, result) => {
        if (err) {
            console.log(err)
            return
        }
        res.send({
            result
        })
    })
});

module.exports = router;